package diskmgr;

import java.io.IOException;

import btree.Interface3;

import global.TID;
import heap.Heapfile;
import heap.InvalidTupleSizeException;
import heap.InvalidTypeException;
import heap.Scan;
import heap.Triple;
import heap.Tuple;

public class Stream extends Scan{

	public Stream(Heapfile hf) throws InvalidTupleSizeException, IOException {
		super(hf);
	}
	
	public Stream(rdfDB refdatabase, int orderType, String subjectfilter, String predicateFilter, String objectFilter, double confidenceFilter) throws InvalidTupleSizeException, IOException{
		super(refdatabase, orderType, subjectfilter, predicateFilter, objectFilter, confidenceFilter);
		//setHeapFile(rdfDB.tripleHeap);
		init();
		switch(orderType){
		case 1:{
			System.out.println("We are using group1 ");
			break;
		}
		case 2:
		case 3:
		default : {System.out.println("This option is not available as of now:"+orderType);}
		}
	}
	
	public void closeStream(){
		super.closescan();
	}
	
	public Triple getNext(TID tid) throws InvalidTupleSizeException, IOException, InvalidTypeException{
		Triple triple = new Triple();
		Tuple tuple = super.getNext(tid);
		triple.tupleCopy(tuple);
		return triple;
	}

}
